﻿@model IEnumerable<ThaireInvestmentWeb.Models.TransactionDataGridAdapter>   
@if (Model.Count() > 0)
{
    var grid = new WebGrid(source: Model);
    @grid.GetHtml(tableStyle: "tablelist", headerStyle: "headertable", displayHeader: true,
                                columns: grid.Columns(
                                    grid.Column(header: "NO.", format: item => item.WebGrid.Rows.IndexOf(item) + 1, canSort: false),
                                    grid.Column(columnName: "TransactionType", header: "Type", canSort: false),
                                    grid.Column(header: "ประเภท SBL/REPO", canSort: false, format: @<text></text>),
                                    grid.Column(columnName: "CounterpartyName", header: "Counter party", canSort: false),
                                    grid.Column(columnName: "TIME2MATURE", header: "Time to Maturity", canSort: false),
                                    grid.Column(columnName: "TransactionType", header: "Transaction", canSort: false),
                                    grid.Column(columnName: "TradeDate", header: "TradeDate", canSort: false),
                                    grid.Column(columnName: "SettlementDate", header: "SettlementDate", canSort: false),
                                    grid.Column(header: "TransactionUnit", canSort: false, format: @<text>TransactionUnit</text>),
                                    grid.Column(header: "RemainUnit", canSort: false, format: @<text>RemainUnit</text>),

                                    grid.Column(columnName: "Par", header: "Par", canSort: false),
                                    grid.Column(columnName: "Yield", header: "Cost Yield (YTM)", canSort: false),
                                    grid.Column(columnName: "TradeDate", header: "Coupon Payment Date", canSort: false),

                                    grid.Column(header: "Coupon Payment Date", canSort: false, format: @<text>Coupon Payment Date</text>),
                                    grid.Column(header: "Coupon", canSort: false, format: @<text>Coupon</text>),
                                    grid.Column(header: "Purchase Value (Local THB)", canSort: false, format: @<text>Purchase Value</text>),

                                    grid.Column(header: "Detail", format:
                                        @<text>
                                        <input type="image" onClick="go('@Url.Action("EditPurchase", "FixedIncome", new { purchaseID = item.FixincomesecuritiesPurchaseId })');return false;"  src="@Url.Content("~/Content/images/b_edit.gif")"  title="แก้ไข">
                                        </text>))
                                    );

}
